function checkSame(value1,value2){
	if(value1 == value2){
		return 1;
	} else {
		return 0;
	}
}
function addClass(obj,name){
	if(!hasClass(obj,name)){
		obj.className += " " + name;
	}
}
function hasClass(obj,name){
	var reg = new RegExp("\\b"+name+"\\b");
	return reg.test(obj.className);
}
function removeClass(obj,name){
	var reg = new RegExp("\\b"+name+"\\b");
	obj.className = obj.className.replace(reg , "");
}
function toggleClass(obj , cn){
	
	//判断obj中是否含有cn
	if(hasClass(obj , cn)){
		//有，则删除
		removeClass(obj , cn);
	}else{
		//没有，则添加
		addClass(obj , cn);
	}
	
}
//自动给父节点添加子节点并加上class名字
function myAppendChildClass(father,sonType,className,innerContent){
	var son = document.createElement(sonType);
	son.className = className;
	son.innerHTML = innerContent;
	father.appendChild(son);
	return son;
}